/**
 * Copyright (c) 2021-2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef PANDA_LIBPANDABASE_PBASE_MACROS_H
#define PANDA_LIBPANDABASE_PBASE_MACROS_H

#define UNLIKELY(exp) (__builtin_expect((exp) != 0, false))  // NOLINT(cppcoreguidelines-macro-usage)
#define UNREACHABLE()
#define UNREACHABLE_CONSTEXPR()
#define ASSERT(exp)

// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define NO_MOVE_CTOR(TypeName)                   \
/* NOLINTNEXTLINE(misc-macro-parentheses) */ \
TypeName(TypeName &&) = delete

// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define NO_MOVE_OPERATOR(TypeName)               \
/* NOLINTNEXTLINE(misc-macro-parentheses) */ \
TypeName &operator=(TypeName &&) = delete

// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define NO_MOVE_SEMANTIC(TypeName) \
NO_MOVE_CTOR(TypeName);        \
NO_MOVE_OPERATOR(TypeName)

// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define NO_COPY_CTOR(TypeName) TypeName(const TypeName &) = delete

// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define NO_COPY_OPERATOR(TypeName) void operator=(const TypeName &) = delete

// Disabling copy ctor and copy assignment operator.
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define NO_COPY_SEMANTIC(TypeName) \
NO_COPY_CTOR(TypeName);        \
NO_COPY_OPERATOR(TypeName)

#ifndef PANDA_TARGET_WINDOWS
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define PANDA_PUBLIC_API __attribute__((visibility ("default")))
#else
#define PANDA_PUBLIC_API __declspec(dllexport)
#endif

#endif  // PANDA_LIBPANDABASE_PBASE_MACROS_H